package com.weslide.weslideapp.parser;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.weslide.weslideapp.pojo.ao.ExchangeScoreAO;

public class ExchangeScoreParser {
	private ExchangeScoreAO exchangeScoreAO = new ExchangeScoreAO();

	public void parser(String jsonString) throws JSONException {
		JSONArray jsonArray = new JSONArray(jsonString);
		JSONObject statusJsonObject = jsonArray.getJSONObject(0);
		exchangeScoreAO.setStatus(statusJsonObject.getString("status"));
		if (exchangeScoreAO.getStatus().equals("1")) {
			JSONObject dataJsonObject = jsonArray.getJSONObject(1);
			exchangeScoreAO.setSeId(dataJsonObject.getString("se_id"));
		}

	}

	public ExchangeScoreAO getData() {
		return exchangeScoreAO;
	}
}
